home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / EnterCD 01_2004.iso / Multimedia / Advanced Effect Maker Freeware Edition 1.0 / aemf10.exe / {app} / templates / crazytext.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2002-10-12  |  4.9 KB  |  127 lines

  1. function initApplet()
  2. {
  3.    setProperty("moviearea", _X, 0);
  4.    setProperty("moviearea", _Y, 0);
  5.    setProperty("expiredapplet", _visible, false);
  6.    var i = 0;
  7.    while(i < maxitems)
  8.    {
  9.       setProperty("moviearea.text" + i, _visible, false);
  10.       c = new Color("moviearea.text" + i);
  11.       c.setRGB(textcolor);
  12.       i++;
  13.    }
  14.    if(3 < backgroundimage.length)
  15.    {
  16.       setProperty("moviearea.backgroundimage", _width, width);
  17.       setProperty("moviearea.backgroundimage", _height, height);
  18.       setProperty("moviearea.backgroundimage", _X, 0);
  19.       setProperty("moviearea.backgroundimage", _Y, 0);
  20.    }
  21.    urls = urls.split("|");
  22.    currentsleeptime = 0;
  23.    currentstep = width * 2;
  24.    var today = new Date();
  25.    trace(today.getTime());
  26.    if(today.getTime() < ts && ts < today.getTime() + 172800000 || ts == -1)
  27.    {
  28.       activated = true;
  29.    }
  30.    else
  31.    {
  32.       setProperty("expiredapplet", _visible, true);
  33.    }
  34. }
  35. function getMix(c1, c2, alpha)
  36. {
  37.    var r1 = c1 >> 16 & 0xFF;
  38.    var g1 = c1 >> 8 & 0xFF;
  39.    var b1 = c1 & 0xFF;
  40.    var r2 = c2 >> 16 & 0xFF;
  41.    var g2 = c2 >> 8 & 0xFF;
  42.    var b2 = c2 & 0xFF;
  43.    var mix = (Math.floor(r1 * alpha / 100) + Math.floor(r2 * (100 - alpha) / 100) << 16) + (Math.floor(g1 * alpha / 100) + Math.floor(g2 * (100 - alpha) / 100) << 8) + (Math.floor(b1 * alpha / 100) + Math.floor(b2 * (100 - alpha) / 100));
  44.    return mix;
  45. }
  46. function run()
  47. {
  48.    if(activated && !finished)
  49.    {
  50.       if(currentsleeptime == 0)
  51.       {
  52.          currentstep -= animationspeed;
  53.       }
  54.       if(0 >= currentstep)
  55.       {
  56.          currentsleeptime = sleeptime;
  57.          currentstep = width * 2;
  58.       }
  59.       if(0 < currentsleeptime)
  60.       {
  61.          currentsleeptime--;
  62.          if(currentsleeptime == 0)
  63.          {
  64.             setProperty("moviearea.text" + currenttext, _visible, false);
  65.             currenttext++;
  66.             nexttext++;
  67.             if(maxitems - 1 < currenttext)
  68.             {
  69.                currenttext = 0;
  70.                if(runonce == 1)
  71.                {
  72.                   finished = true;
  73.                   if(0 < nextmovie.length())
  74.                   {
  75.                      loadMovie(nextmovie,_level0);
  76.                   }
  77.                }
  78.             }
  79.             if(maxitems - 1 < nexttext)
  80.             {
  81.                nexttext = 0;
  82.             }
  83.          }
  84.       }
  85.       if(currentsleeptime == 0)
  86.       {
  87.          setProperty("moviearea.text" + currenttext, _Y, height / 20);
  88.          setProperty("moviearea.text" + currenttext, _X, int(currentstep * Math.sin(currentstep / (width / movementrate))));
  89.          setProperty("moviearea.text" + currenttext, _visible, true);
  90.       }
  91.       point.x = this._xmouse;
  92.       point.y = this._ymouse;
  93.       localToGlobal(point);
  94.       if(mousedown)
  95.       {
  96.          getURL(urls[currenttext],target);
  97.       }
  98.       if(mousedown)
  99.       {
  100.          mousedown = false;
  101.       }
  102.    }
  103. }
  104. var currenttext = 0;
  105. var nexttext = 1;
  106. var currentstep = 100;
  107. var nextstep = 0;
  108. var mousedown = false;
  109. var point = new object();
  110. var currentsleeptime = 0;
  111. var activated = false;
  112. var finished = false;
  113. var runonce = parseInt("0",10);
  114. var nextmovie = "";
  115. var maxitems = parseInt("3",10);
  116. var backgroundimage = "scenery2.jpg";
  117. var ap = "<APPLETINFO>\r\nappletname=crazytext\r\nappletfilename=crazytext1.swf\r\ncreated=1016439368440\r\n</APPLETINFO>\r\n<ACTIONSCRIPT>\r\nwidth=200\r\nheight=70\r\nanimationspeed=7\r\nmovementrate=6\r\nsleeptime=30\r\ntarget=_self\r\nnextmovie=\r\nbackgroundimage=scenery2.jpg\r\nmaxitems=3\r\nurls=http://www.effectmaker.com/clickpage.html|http://www.effectmaker.com/clickpage.html|http://www.effectmaker.com/clickpage.html|\r\ntext=This is the crazytext}Flash applet...|As you see, it supports}multiple lines of}text...|Register at Advanced}Effect Maker now, to get this applet!}http://www.effectmaker.com/|\r\ntextcolor=65280\r\nbackgroundcolor=0\r\nrunonce=0\r\n</ACTIONSCRIPT>\r\n<HTML>\r\nwidth=200\r\nheight=70\r\n</HTML>\r\n<GENERATED>\r\nwidth=200\r\nheight=70\r\nfontsize=14\r\nfontsize_GS=4\r\ncompressionratio=70\r\ncompressionratio_GS=12;-\r\ndependentfiles=scenery2.jpg\r\ndependentfiles_GS=-\r\nfont=_arial\r\nfont_GS=3;-\r\nbackgroundimage=scenery2.jpg\r\nbackgroundimage_GS=7;compressionratio\r\nmaxitems=3\r\ntext_GS=6;font;fontsize;alignment\r\ntext=This is the crazytext}Flash applet...|As you see, it supports}multiple lines of}text...|Register at Advanced}Effect Maker now, to get this applet!}http://www.effectmaker.com/|\r\nalignment_GS=5\r\nalignment=2;\r\nbackgroundcolor=000000\r\n</GENERATED>";
  118. var ts = "-1";
  119. var animationspeed = parseInt("7",10);
  120. var movementrate = parseInt("6",10);
  121. var urls = "http://www.effectmaker.com/clickpage.html|http://www.effectmaker.com/clickpage.html|http://www.effectmaker.com/clickpage.html|";
  122. var target = "_self";
  123. var sleeptime = parseInt("30",10);
  124. var width = parseInt("200",10);
  125. var height = parseInt("70",10);
  126. var textcolor = parseInt("65280");
  127.